package MineGod;

import java.util.ArrayList;

public abstract class GUI {

	
	public ArrayList<GUIButton> buttons = new ArrayList<GUIButton>();
	public ArrayList<GUILabel> labels = new ArrayList<GUILabel>();
	public double zIndex = -10;
	
	
	public void refreshGUI(MineGod game){
		updateButtons(game);
		updateLabels(game);
	}
	
	public abstract void updateButtons(MineGod game);
	public abstract void updateLabels(MineGod game);
	
	public void handleMouseMovement(double mouseX, double mouseY){
		for(GUIButton b: buttons){
			if(b.isMouseOn(mouseX, mouseY)){
				b.mouseOn(mouseX, mouseY);
			}
		}
	}
	
	public void handleMouseDown(MineGod game, double mouseX, double mouseY){
		for(GUIButton b: buttons){
			if(b.isMouseOn(mouseX, mouseY)){
				b.mouseClickedOn(game);
			}
		}
	}
	
	public void render(){
		for(GUIButton b: buttons){
			b.render(zIndex);
		}
		for(GUILabel l: labels){
			l.render(zIndex);
		}
	}
	
	
	
}
